//一般直接写在一个js文件中
layui.use(['element','form','laydate'],function () {
    var laydate = layui.laydate,
           form=layui.form;
    laydate.render({
            elem: '#foodDate'
        });
    laydate.render({
        elem: '#foodTime'
        ,type: 'time'
    });
    form.verify({
        eburdenFood: function(value, item){ //value：表单的值、item：表单的DOM对象
            if (value.length>10){
                if(value.indexOf(",")==-1 && value.indexOf("，")==-1 && value.indexOf("、")==-1 )
                    return '配料必须用逗号’,‘或者’、‘分开';
            }
        }
    });
});